<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
            }

            .col-input {
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:growl id="msgs" showDetail="false"/>
            <h:form id="form">
                <p:panel header="【客户访谈信息】查询条件">
                    <h:panelGrid columns="2" columnClasses="col-80,col-20">
                        <h:panelGrid columns="4" cellspacing="3"
                                     columnClasses="col-95,col-5,col-95,col-5">
                            <h:outputLabel value="客户号:" for="custno"/>
                            <h:inputText id="custno" size="30"
                                         value="#{interviewAction.paramCustomer.custno}"/>
                            <h:outputLabel value="客户名称:" for="custname"/>
                            <h:inputText id="custname" size="30"
                                         value="#{interviewAction.paramCustomer.custname}"/>
                            <h:outputLabel value="访谈人:" for="interOper"/>
                            <h:inputText id="interOper" size="30"
                                         value="#{interviewAction.paramCustomer.interOper}"/>
                            <h:outputLabel value="访谈起始日:" for="startdate"/>
                            <p:inputMask mask="9999-99-99" id="startdate" size="28"
                                         value="#{interviewAction.paramCustomer.interDate}">
                            </p:inputMask>
                            <h:outputLabel value="访谈截止日:" for="enddate"/>
                            <p:inputMask mask="9999-99-99" id="enddate" size="28"
                                         value="#{interviewAction.paramCustomer.endDate}">
                            </p:inputMask>
                            <h:outputLabel value="贷款方式:" for="loanType"/>
                            <p:selectOneMenu id="loanType" style="width:190px;"
                                             value="#{interviewAction.paramCustomer.loanType}">
                                <f:selectItem itemValue="" itemLabel=" "/>
                                <f:selectItems value="#{interviewAction.loanTypes}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="访谈结果:" for="interResult"/>
                            <p:selectOneMenu id="interResult" style="width:190px;"
                                             value="#{interviewAction.paramCustomer.interResult}">
                                <f:selectItem itemValue="" itemLabel=" "/>
                                <f:selectItems value="#{interviewAction.interviewResults}"/>
                            </p:selectOneMenu>

                        </h:panelGrid>

                        <h:panelGrid columns="1">
                            <p:commandButton id="qrybtn" style="width:60px;margin-left:70px;" value="查询"
                                             action="#{interviewAction.onQuery}"
                                             update="pdt,msgs">
                            </p:commandButton>
                            <p:commandButton ajax="false" id="btnprt" value="重置"
                                             type="reset"
                                             style="width:60px;margin-left:70px;"/>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>

                <p:ajaxStatus style="height:18px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:dataTable id="pdt" style="width:100%;align:center;"
                             value="#{interviewAction.loanInfoList}" var="record"
                             rowKey="#{record.pkid}"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true" rows="30" paginatorPosition="bottom"
                             rowsPerPageTemplate="100,50,30,15,5"
                             emptyMessage="数据记录为空...">
                    <p:column headerText="客户号" sortBy="#{record.custNo}">
                        <h:outputText value="#{record.custNo}" style="text-align:left;"/>
                    </p:column>
                    <p:column headerText="客户名称">
                        <h:outputText value="#{record.custName}" style="text-align:left;"/>
                    </p:column>
                    <p:column headerText="贷款方式">
                        <h:outputText value="#{interviewAction.loanKVTypes[record.loanType]}" style="text-align:left;"/>
                    </p:column>
                    <p:column headerText="融资金额" sortBy="#{record.loanAmt}" style="text-align:right;">
                        <h:outputText value="#{record.loanAmt}" style="text-align:right;">
                            <f:convertNumber pattern="###,##0.00"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="访谈时间" sortBy="#{record.txndate}">
                        <h:outputText value="#{record.txndate} #{record.txntime}" style="text-align:center;"/>
                    </p:column>

                    <p:column headerText="访谈人">
                        <h:outputText value="#{record.operid}" style="text-align:right;"/>
                    </p:column>
                    <p:column headerText="访谈结果">
                        <h:outputText value="#{interviewAction.interviewKVResults[record.interResult]}"
                                      style="text-align:left;"/>
                    </p:column>
                    <p:column headerText="拒绝原因">
                        <h:outputText value="#{interviewAction.refuseKVReasons[record.interReason]}"
                                      style="text-align:left;"/>
                    </p:column>
                    <p:column headerText="备注">
                        <h:outputText value="#{record.remark}" style="text-align:left;"/>
                    </p:column>

                </p:dataTable>
            </h:form>
        </div>
    </ui:define>

</ui:composition>